< previous page page_393 next page >

Page 393
Creating Your Own Button Bar Routines
The next three routines handle all the operations needed to add a complete set of command buttons to your data entry form. You can use this set for any data entry form that provides the basic add, edit, delete, find, and browse operations needed for most data entry routines.
warning.gif
To make these routines work with your programs, you must add a single command button to your form called cmdBtn. Its Index property must be set to 0 to indicate that it is part of a control array. The details of constructing a working form are covered in the "Creating a Data Entry Form with the Library Routines" section of this lesson.

The BBInit Routine
The BBInit routine builds the details of the command button array and places that array on your data entry form. You must first place a single command button on the target form with its Name property set to cmdBtn and its Index property set to 0. This routine creates seven more command buttons, sets their captions and sizes, and places the button set on the top, bottom, left, or right side of the form. You control this feature by setting the BtnBarAlign property you defined earlier. Add this routine (in Listing 10.17) to the OLE Server library module that contains the record-handling routines.
Type.gifListing 10.17. Coding the BBInit routine.
Public Function BBInit(frmTemp As Object)
    '
    ' initialize a button bar on the form
    '
    Dim intBtnWidth As Integer
    Dim intBtnTop As Integer
    Dim intBtnleft As Integer
    Dim intBtnHeight As Integer
    Dim intLoop As Integer
    Dim varCap As Variant
    '
    varCap = Array("&Add", "&Edit", "&Del", "&Find", "&Top", "&Next",
arrow.gif"&Back", "&Last")
    '
continues

 
< previous page page_393 next page >

If you like this book, buy it!